
///------------------------------
//QT embeded wave playing class
//2011.10.6 V1.0
///-----------------------------
#ifndef AUDIO_H
#define AUDIO_H

#define OPEN_DSP_FAILED     0x00000001      /*打开  dsp 失败!*/

#define SAMPLERATE_STATUS     0x00000002    /*samplerate status failed*/

#define SET_SAMPLERATE_FAILED  0x00000003   /*set samplerate failed*/

#define CHANNELS_STATUS       0x00000004    /*Channels status failed*/

#define SET_CHANNELS_FAILED    0x00000005   /*set channels failed*/

#define FMT_STATUS       0x00000006        /*FMT status failed*/

#define SET_FMT_FAILED     0x00000007       /*set fmt failed*/

#define OPEN_FILE_FAILED        0x00000008    /*opem filed failed*/

#include <unistd.h>

#include <fcntl.h>

#include <sys/types.h>

#include <sys/stat.h>

#include <sys/ioctl.h>

#include <stdlib.h>

#include <stdio.h>

#include <string.h>

#include <linux/soundcard.h>

//#include <QSound>

class Audio
{

public:
    static int play(const char *pathname,int nSampleRate,int nChannels,int fmt);
    //
    static void playError();
    static void playKeyOrTouch();
};

//  calling formating/ sample
//  my_Audio_Play("error.wav",22050,1,16);
#endif // AUDIO_H



